package com.beerbear.eurekaservicesecond.controller;

import com.beerbear.eurekaservicesecond.service.OneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/secondService")
public class OneController {

    @Autowired
    private OneService service;

    @GetMapping("/call")
    public HashMap getMyService(){
        HashMap response = new HashMap();
        response.put("success","恭喜你成功调用了服务二的接口");
        return response;
    }

    /**
     * create by: Beer Bear
     * description: 调用服务一的接口
     * create time: 2021/8/18 21:39
     */
    @GetMapping("/callService1")
    public HashMap callService1(){
        return service.callService1();
    }
}
